package creational.factory;

/**
 * @Description: PostgreSQL方言
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class PostgresDialect implements DataBaseDialect {
    public String getCountRowsSql(String catalog, String schema, String tableName) {
        return "SELECT RELTUPLES AS NUMBER FROM PG_CLASS WHERE RELKIND = 'R' AND RELNAME = '" + tableName
                + "' AND RELNAMESPACE = (SELECT OID FROM PG_NAMESPACE WHERE NSPNAME ='" + schema + "')";
    }
}
